package net.hombrecero.bigbeat.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.AccessType;

@Entity
@AccessType( "field" )
public class Node extends Base {

    @ManyToOne( cascade = { CascadeType.PERSIST, CascadeType.MERGE } )
    @JoinColumn( name="uuidDriver", nullable=false )
    private Driver driver;
    @ManyToOne( cascade = { CascadeType.PERSIST, CascadeType.MERGE } )
    @JoinColumn( name="uuidUser", nullable=false )
    private User user;
	@Column( length=32, nullable = false )
	private String name;
	@Column( length=32, nullable = false )
	private String ip;



	public Driver getDriver() {
		return this.driver;
	}
	public void setDriver( Driver driver ) {
		this.driver = driver;
	}
	public User getUser() {
		return this.user;
	}
	public void setUser( User user ) {
		this.user = user;
	}
	public String getName() {
		return this.name;
	}
	public void setName( String name ) {
		this.name = name;
	}
	public String getIp() {
		return this.ip;
	}
	public void setIp( String alias ) {
		this.ip = alias;
	}
}
